#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>

int main()
{
	FILE *fp;
	char buf[80];
	printf("open and create test_fiel \n");
	if((fp = fopen("test_file", "w")) == NULL)
	{
		perror("fopen failed!\n");
		exit(1);
	}
	printf("wrting string to testfile \n");
	fputf("test date", fp);
	if((fp = freopen("test_file", "r", fp)) != NULL)
	{
		perror("freopen failed!\n");
	}
	printf("read")
	fprintf(fp, "%s\n", "hello!");
	fclose(fp);
	return 0;
}
